﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoVanHocTapData.Interface;
using CoVanHocTapData.Entities;

namespace CoVanHocTapData.Concretes
{
    public class ChuongTrinhDaoTaoTheoHocKyRepository:IChuongTrinhDaoTaoTheoHocKyRepository
    {
        #region property
        static DangKyPhuEntities entities =new DangKyPhuEntities();
        #endregion

        #region constructor
        public ChuongTrinhDaoTaoTheoHocKyRepository()
        {
            
        }
        #endregion

        #region IChuongTrinhDaoTaoTheoHocKyRepository Members

        public static IQueryable<Entities.ChuongTrinhDaoTaoTheoHocKy> LayCTDTTheoHocKy(string nganhID, string heDaoTaoID,int nienKhoaID, List<int> hocKyList)
        {
            return from m in entities.ChuongTrinhDaoTaoTheoHocKies
                   where m.HeDaoTaoID.Equals(heDaoTaoID)
                   && m.NganhID.Equals(nganhID)
                   && m.NienKhoaID == nienKhoaID
                   && hocKyList.Contains(m.HocKy.Value)
                   select m;
        }

        #endregion
    }
}
